import request from './request'

/**
 * 获取用户列表
 */
export const getUserList = (params) => {
  return request.get('/admin/users', { params })
}

/**
 * 获取用户详情
 */
export const getUserById = (id) => {
  return request.get(`/admin/users/${id}`)
}

/**
 * 创建用户
 */
export const createUser = (data) => {
  return request.post('/admin/users', data)
}

/**
 * 更新用户
 */
export const updateUser = (id, data) => {
  return request.put(`/admin/users/${id}`, data)
}

/**
 * 删除用户
 */
export const deleteUser = (id) => {
  return request.delete(`/admin/users/${id}`)
}

/**
 * 获取管理员个人资料
 */
export const getAdminProfile = () => {
  return request.get('/admin/profile')
}

/**
 * 更新管理员个人资料
 */
export const updateAdminProfile = (data) => {
  return request.put('/admin/profile', data)
}

/**
 * 修改管理员密码
 */
export const changeAdminPassword = (data) => {
  return request.put('/admin/password', data)
}

